package com.allscore.demo.boot.nacos.config;

import com.alibaba.nacos.api.config.annotation.NacosValue;
import com.alibaba.nacos.spring.context.annotation.config.NacosPropertySource;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

/**
 *
 * @author Administrator
 */
@Component
@Scope("singleton")
@NacosPropertySource(dataId = "demo-nacos-cmm", autoRefreshed = true, groupId = "database")
public class CmmConfig {

    @NacosValue(value = "${user.id:1000}", autoRefreshed = true)
    private Integer id;

    @NacosValue(value = "${user.name:xiaoming}", autoRefreshed = true)
    private String name="xiaoming";

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public String toString() {
        return "CmmConfig{" + "id=" + id + ", name=" + name + '}';
    }

}
